package com.autumn.xa.a.demo.maths;

import java.util.HashMap;
import java.util.Map;

/**
 * 项目名称：com.autumn.xa
 * 类 名 称：MathDemo
 * 类 描 述：TODO
 * 创建时间：2021/9/13 7:29 下午
 * 创 建 人：yeachrom
 */
public class MathDemo {
    static void math1(){
        System.out.println(Math.round(11.5));
        System.out.println(Math.round(-11.5));
        System.out.println(Math.round(11.1));
        System.out.println(Math.round(11.9));
    }
    static void math2(){
        int a = 666;
        int b = 777;
        a = a + b;
        b = a - b;
        a = a - b;
        System.out.println(a);
        System.out.println(b);
    }

    static void math3(){
        Integer f1 = 100, f2 = 100, f3 = 150, f4 = 150;
        // -128到127之间， integer 不会new新的对象。直接引用常量池中的对象
        System.out.println(f1 == f2);
        System.out.println(f3 == f4);
    }

    static void math4(){
        String str1 = "通话";
        String str2 = "重地";
        System.out.println(String.format("str1：%d | str2：%d",  str1.hashCode(),str2.hashCode()));
        System.out.println(str1.equals(str2));
    }

    public static void main(String[] args) {
        math4();

        Map<String,String> map = new HashMap<>();
        map.put("","");
    }
}
